package com.seu.controller;

import com.seu.client.ProviderClient;
import com.seu.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    @Autowired
    ProviderClient providerClient;

    @Autowired
    ProviderService providerService;

    @GetMapping("/serviceConsumer")
    public String service(){
/*        //本地调用
        String providerResult = providerService.service();*/

        //远程调用
        String providerResult = providerClient.service();
        return "consumer invoke"+"|"+providerResult;
    }

}
